<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
  import {debounce} from '@/ui/common/lang/debounce';

  export default {
	name: "app",
	provide() {
	  return {
		reload: this.reload
	  };
	},
	data() {
	  return {
		isRouterAlive: true
	  };
	},
	mounted() {
	  window.onresize = debounce(() => {
		this.$store.dispatch('resize');
	  }, 100)
	},
	methods: {
	  reload: function () {
		this.isRouterAlive = false;
		this.$nextTick(() => {
		  this.isRouterAlive = true;
		});
	  }
	}
  };
</script>
